<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>后台管理系统</title>
<meta name="author" content="DeathGhost" />
<link rel="stylesheet" type="text/css"
	href="/xiaorong/resources/css/style.css" />
<script src="/xiaorong/resources/js/jquery.js"></script>
<script src="/xiaorong/resources/js/jquery.mCustomScrollbar.concat.min.js"></script>
<script type="text/javascript" src="/xiaorong/resources/js/jquery.validate.js"></script>
 <!--弹出框效果-->
<script>
	$(document).ready(function() {
		$("#submit").click(function(){
			$("form").submit();
		});
		
		$("form").validate({
			rules: {
				sn : {
					required : true,
					remote :  {
						url: "checkSn.do",
						data: {
							sn: function(){
								return $("#sn").val();
							},
							orderType: $("#orderType").val()
						}
					}
				},
				cardNo : "required"
			},
			messages: {
				sn: {
					remote : "<span class='errorTips'>订单号已存在</span>"
				}
			},
            submitHandler: function (form) {
            	$.ajax({
        			url:  $("form").attr("action"),
        			data: $("form").serialize(),
        			type: "post",
        			success: function(data){
        				if(data == true){
        					$.message("success", "操作成功");
        					setTimeout(function(){
        						layer.close();
        						},1000);
        				}else{
        					$.message("error", "操作失败");
        				}
        			}
        		});
            }
			
		});
	});
	
</script>
</head>
<body>
	<!--header-->
	<jsp:include page="../common/header.jsp"></jsp:include>
	
	<section class="rt_wrap content mCustomScrollbar" style="margin: 0 auto;">
			<div class="rt_content">
				<p>&nbsp;</p>
				<div class="page_title">
					<h2 class="fl">编辑</h2>
					<a class="fr top_rt_btn" id="submit">保存</a>
				</div>
				<!--content-->
				<div class="pop_cont_input">
					<form action="${empty order? 'save':'update'}.do" method="post">
						<input type="hidden" name="id" value="${order.id }">
						<input type="hidden" id="orderType" name="orderType" value="${orderType}">
						<table class="table">
							<tr>
								<th>订单号:</th>
								<td>
									<c:if test="${empty order }">
										<input size="35" id="sn" name="sn" value="${order.sn }" >
									</c:if>
									<c:if test="${not empty order }">
										<input type="hidden" id="sn" size="35" name="sn" value="${order.sn }" >
										<span style="color:orange;">${order.sn }</span>
									</c:if>
								</td>
								<th>卡号:</th>
								<td><input size="35" name="cardNo" value="${order.cardNo }"></td>
							</tr>
							<tr>
								<th>持卡人:</th>
								<td><input size="35" name="cardKeeper" value="${order.cardKeeper }"></td>
								<th>IP国家:</th>
								<td><input size="35" name="ipCountry" value="${order.ipCountry }"></td>
							</tr>
							<tr>
								<th>乘机人1:</th>
								<td><input size="35" name="passengerOne" value="${order.passengerOne }"></td>
								<th>乘机人2:</th>
								<td><input size="35" name="passengerTwo" value="${order.passengerTwo }"></td>
							</tr>
							<tr>
								<th>航程:</th>
								<td><input size="35" name="voyage" value="${order.voyage }"></td>
								<th>处理结果:</th>
								<td><input size="35" name="result" value="${order.result }"></td>
							</tr>
							<tr>
								<th>联系电话:</th>
								<td><input size="35" name="telphone" value="${order.telphone }"></td>
								<th>邮箱:</th>
								<td><input size="35" name="email" value="${order.email }"></td>
							</tr>
							<tr>
								<th>金额</th>
								<td><input size="35" name="amount" value="${order.amount }"></td>
								<th>备注</th>
								<td><input size="35" name="remark" value="${order.remark }"></td>
							</tr>
							<tr>
								<th>票号</th>
								<td><input size="35" name="ticketNo" value="${order.ticketNo }"></td>
								<th>航班日期</th>
								<td><input size="35" name="flightDate" value="${order.flightDate }"></td>
							</tr>
							<tr>
								<th>报告日期</th>
								<td><input size="35" name="reportDate" value="${order.reportDate }" onclick="WdatePicker();"></td>
								<th>订单日期</th>
								<td><input size="35" name="orderDate" value="${order.orderDate }" onclick="WdatePicker();"></td>
							</tr>
							
							<tr>
								<th>拒付原因:</th>
								<td><input size="35" name="refuseResult" value="${order.refuseResult}"></td>
								<th>卡种:</th>
								<td><input size="35" name="cardSpecies" value="${order.cardSpecies}"></td>
							</tr>
							<tr>
								<th>购买者所在国家:</th>
								<td><input size="35" name="buyerCountry" value="${order.buyerCountry}"></td>
								<th></th>
								<td></td>
							</tr>
							
							<!-- 拓展字段 -->
							<tr>
								<th>拓展属性1:</th>
								<td><input size="35" name="attribute1" value="${order.attribute1}"></td>
								<%-- <th>拓展属性2:</th>
								<td><input size="35" name="attribute2" value="${order.attribute2}"></td> --%>
							</tr>
							<%-- <tr>
								<th>拓展属性3:</th>
								<td><input size="35" name="attribute3" value="${order.attribute3}"></td>
								<th>拓展属性4:</th>
								<td><input size="35" name="attribute4" value="${order.attribute4}"></td>
							</tr>
							<tr>
								<th>拓展属性5:</th>
								<td><input size="35" name="attribute5" value="${order.attribute5}"></td>
								<th>拓展属性6:</th>
								<td><input size="35" name="attribute6" value="${order.attribute6}"></td>
							</tr>
							<tr>
								<th>拓展属性7:</th>
								<td><input size="35" name="attribute7" value="${order.attribute7}"></td>
								<th>拓展属性8:</th>
								<td><input size="35" name="attribute8" value="${order.attribute8}"></td>
							</tr>
							<tr>
								<th>拓展属性9:</th>
								<td><input size="35" name="attribute9" value="${order.attribute9}"></td>
								<th></th>
								<td></td>
							</tr> --%>
							
						</table>
					</form>
				</div>
			</div>
		</section>
		<!--结束：弹出框效果-->
</body>
</html>
